<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns# article: http://ogp.me/ns/article# " lang="en">
<head>
<meta charset="utf-8">
<meta name="description" content="Tj2's Blog">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>绿萝间 (old posts, page 191) | 绿萝间</title>
<link href="assets/css/all-nocdn.css" rel="stylesheet" type="text/css">
<link href="assets/css/ipython.min.css" rel="stylesheet" type="text/css">
<link href="assets/css/nikola_ipython.css" rel="stylesheet" type="text/css">
<meta name="theme-color" content="#5670d4">
<meta name="generator" content="Nikola (getnikola.com)">
<link rel="alternate" type="application/rss+xml" title="RSS" href="rss.xml">
<link rel="canonical" href="https://muxuezi.github.io/index-191.html">
<link rel="prev" href="index-192.html" type="text/html">
<link rel="next" href="index-190.html" type="text/html">
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
        processEscapes: true
    },
    displayAlign: 'center', // Change this to 'center' to center equations.
    "HTML-CSS": {
        styles: {'.MathJax_Display': {"margin": 0}}
    }
});
</script><!--[if lt IE 9]><script src="assets/js/html5.js"></script><![endif]-->
</head>
<body>
<a href="#content" class="sr-only sr-only-focusable">Skip to main content</a>

<!-- Menubar -->

<nav class="navbar navbar-inverse navbar-static-top"><div class="container">
<!-- This keeps the margins nice -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-navbar" aria-controls="bs-navbar" aria-expanded="false">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="https://muxuezi.github.io/">

                <span id="blog-title">绿萝间</span>
            </a>
        </div>
<!-- /.navbar-header -->
        <div class="collapse navbar-collapse" id="bs-navbar" aria-expanded="false">
            <ul class="nav navbar-nav">
<li>
<a href="archive.html">Archive</a>
                </li>
<li>
<a href="categories/">Tags</a>
                </li>
<li>
<a href="rss.xml">RSS feed</a>

                
            </li>
</ul>
<ul class="nav navbar-nav navbar-right"></ul>
</div>
<!-- /.navbar-collapse -->
    </div>
<!-- /.container -->
</nav><!-- End of Menubar --><div class="container" id="content" role="main">
    <div class="body-content">
        <!--Body content-->
        <div class="row">
            
            

    
<div class="postindex">
    <article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/dlott-15116-2015-10-05-report.html" class="u-url">大乐透15116期(2015-10-05)数据分析报告</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/dlott-15116-2015-10-05-report.html" rel="bookmark"><time class="published dt-published" datetime="2015-10-06T08:00:00+08:00" title="2015-10-06 08:00">2015-10-06 08:00</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p>如有雷同，纯属巧合</p>
<p class="more"><a href="posts/dlott-15116-2015-10-05-report.html">Read more…</a></p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/slott-2015116-2015-10-04-report.html" class="u-url">双色球2015116期(2015-10-04)数据分析报告</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/slott-2015116-2015-10-04-report.html" rel="bookmark"><time class="published dt-published" datetime="2015-10-05T08:00:00+08:00" title="2015-10-05 08:00">2015-10-05 08:00</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p>如有雷同，纯属巧合</p>
<p class="more"><a href="posts/slott-2015116-2015-10-04-report.html">Read more…</a></p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/dlott-15115-2015-10-03-report.html" class="u-url">大乐透15115期(2015-10-03)数据分析报告</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/dlott-15115-2015-10-03-report.html" rel="bookmark"><time class="published dt-published" datetime="2015-10-04T08:00:00+08:00" title="2015-10-04 08:00">2015-10-04 08:00</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p>如有雷同，纯属巧合</p>
<p class="more"><a href="posts/dlott-15115-2015-10-03-report.html">Read more…</a></p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/6utilizing-parallel-python.html" class="u-url">6.Utilizing Parallel Python</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/6utilizing-parallel-python.html" rel="bookmark"><time class="published dt-published" datetime="2015-10-03T12:44:35+08:00" title="2015-10-03 12:44">2015-10-03 12:44</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div tabindex="-1" id="notebook" class="border-box-sizing">
    <div class="container" id="notebook-container">

<div class="cell border-box-sizing text_cell rendered">
<div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="用Parallel-Python模块">用Parallel Python模块<a class="anchor-link" href="posts/6utilizing-parallel-python.html#%E7%94%A8Parallel-Python%E6%A8%A1%E5%9D%97">¶</a>
</h2>
<p>上一章我们用<code>multiprocessing</code>和<code>ProcessPoolExecutor</code>模块演示了两个例子。这一章我们将介绍命名队列（named pipe）的用法，以及如何用<strong> Parallel Python (PP)</strong>模块的进程解决问题。</p>
<p>本章内容包括以下主题：</p>
<ul>
<li>理解进程间通信概念</li>
<li>介绍PP模块</li>
<li>用PP在SMP架上计算Fibonacci数列</li>
<li>用PP实现并行网络爬虫</li>
</ul>
<p class="more"><a href="posts/6utilizing-parallel-python.html">Read more…</a></p>
</div>
</div>
</div>
</div>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/slott-2015115-2015-10-01-report.html" class="u-url">双色球2015115期(2015-10-01)数据分析报告</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/slott-2015115-2015-10-01-report.html" rel="bookmark"><time class="published dt-published" datetime="2015-10-02T08:00:00+08:00" title="2015-10-02 08:00">2015-10-02 08:00</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p>如有雷同，纯属巧合</p>
<p class="more"><a href="posts/slott-2015115-2015-10-01-report.html">Read more…</a></p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/dlott-15114-2015-09-30-report.html" class="u-url">大乐透15114期(2015-09-30)数据分析报告</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/dlott-15114-2015-09-30-report.html" rel="bookmark"><time class="published dt-published" datetime="2015-10-01T08:00:00+08:00" title="2015-10-01 08:00">2015-10-01 08:00</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p>如有雷同，纯属巧合</p>
<p class="more"><a href="posts/dlott-15114-2015-09-30-report.html">Read more…</a></p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/slott-2015114-2015-09-29-report.html" class="u-url">双色球2015114期(2015-09-29)数据分析报告</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/slott-2015114-2015-09-29-report.html" rel="bookmark"><time class="published dt-published" datetime="2015-09-30T08:00:00+08:00" title="2015-09-30 08:00">2015-09-30 08:00</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p>如有雷同，纯属巧合</p>
<p class="more"><a href="posts/slott-2015114-2015-09-29-report.html">Read more…</a></p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/5using-multiprocessing-and-processpoolexecutor.html" class="u-url">5.Using Multiprocessing and ProcessPoolExecutor</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/5using-multiprocessing-and-processpoolexecutor.html" rel="bookmark"><time class="published dt-published" datetime="2015-09-29T20:53:28+08:00" title="2015-09-29 20:53">2015-09-29 20:53</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div tabindex="-1" id="notebook" class="border-box-sizing">
    <div class="container" id="notebook-container">

<div class="cell border-box-sizing text_cell rendered">
<div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="用multiprocessing和ProcessPoolExecutor模块">用<code>multiprocessing</code>和<code>ProcessPoolExecutor</code>模块<a class="anchor-link" href="posts/5using-multiprocessing-and-processpoolexecutor.html#%E7%94%A8multiprocessing%E5%92%8CProcessPoolExecutor%E6%A8%A1%E5%9D%97">¶</a>
</h2>
<p>上一章我们用<code>threading</code>模块演示了两个例子。这一章我们将介绍<code>multiprocessing</code>的用法，实现与<code>threading</code>类似的接口。但是，我们将用进程范式。</p>
<p>本章内容包括以下主题：</p>
<ul>
<li>理解进程的概念</li>
<li>理解多进程通信</li>
<li>用<code>multiprocessing</code>实现多请求的Fibonacci数列</li>
<li>用<code>ProcessPoolExecutor</code>实现并行网络爬虫</li>
</ul>
<p class="more"><a href="posts/5using-multiprocessing-and-processpoolexecutor.html">Read more…</a></p>
</div>
</div>
</div>
</div>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/dlott-15113-2015-09-28-report.html" class="u-url">大乐透15113期(2015-09-28)数据分析报告</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/dlott-15113-2015-09-28-report.html" rel="bookmark"><time class="published dt-published" datetime="2015-09-29T08:00:00+08:00" title="2015-09-29 08:00">2015-09-29 08:00</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div>
<p>如有雷同，纯属巧合</p>
<p class="more"><a href="posts/dlott-15113-2015-09-28-report.html">Read more…</a></p>
</div>
    </div>
    </article><article class="h-entry post-text"><header><h1 class="p-name entry-title"><a href="posts/4using-the-threading-and-concurrentfutures-modules.html" class="u-url">4.Using the threading and concurrent.futures Modules</a></h1>
        <div class="metadata">
            <p class="byline author vcard"><span class="byline-name fn">
                Tao Junjie
            </span></p>
            <p class="dateline"><a href="posts/4using-the-threading-and-concurrentfutures-modules.html" rel="bookmark"><time class="published dt-published" datetime="2015-09-28T20:42:03+08:00" title="2015-09-28 20:42">2015-09-28 20:42</time></a></p>
        </div>
    </header><div class="p-summary entry-summary">
    <div tabindex="-1" id="notebook" class="border-box-sizing">
    <div class="container" id="notebook-container">

<div class="cell border-box-sizing text_cell rendered">
<div class="prompt input_prompt">
</div>
<div class="inner_cell">
<div class="text_cell_render border-box-sizing rendered_html">
<h2 id="4.用threading和concurrent.futures模块">4.用<code>threading</code>和<code>concurrent.futures</code>模块<a class="anchor-link" href="posts/4using-the-threading-and-concurrentfutures-modules.html#4.%E7%94%A8threading%E5%92%8Cconcurrent.futures%E6%A8%A1%E5%9D%97">¶</a>
</h2>
<p>在上一章，我们总结了并行思想可以解决的一些问题。这一章，我们将用Python的<code>threading</code>模块实现每个问题的解决方案。</p>
<p>本章内容包括以下主题：</p>
<ul>
<li>线程的定义</li>
<li>
<code>threading</code>和<code>_thread</code>的选择</li>
<li>用<code>threading</code>实现多请求的Fibonacci数列</li>
<li>用<code>concurrent.futures</code>模块实现网络爬虫</li>
</ul>
<p class="more"><a href="posts/4using-the-threading-and-concurrentfutures-modules.html">Read more…</a></p>
</div>
</div>
</div>
</div>
</div>
    </div>
    </article>
</div>

        <nav class="postindexpager"><ul class="pager">
<li class="previous">
                <a href="index-192.html" rel="prev">Newer posts</a>
            </li>
            <li class="next">
                <a href="index-190.html" rel="next">Older posts</a>
            </li>
        </ul></nav><script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"> </script><script type="text/x-mathjax-config">
MathJax.Hub.Config({
    tex2jax: {
        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
        processEscapes: true
    },
    displayAlign: 'center', // Change this to 'center' to center equations.
    "HTML-CSS": {
        styles: {'.MathJax_Display': {"margin": 0}}
    }
});
</script>
</div>
        <!--End of body content-->

        <footer id="footer">
            Contents © 2017         <a href="mailto:muxuezi@gmail.com">Tao Junjie</a> - Powered by         <a href="https://getnikola.com" rel="nofollow">Nikola</a>         
<a rel="license" href="http://creativecommons.org/licenses/by-nc-sa/4.0">
<img alt="Creative Commons License BY-NC-SA" style="border-width:0; margin-bottom:12px;" src="http://i.creativecommons.org/l/by-nc-sa/4.0/80x15.png"></a>
            
        </footer>
</div>
</div>


            <script src="assets/js/all-nocdn.js"></script><script>$('a.image-reference:not(.islink) img:not(.islink)').parent().colorbox({rel:"gal",maxWidth:"100%",maxHeight:"100%",scalePhotos:true});</script><!-- fancy dates --><script>
    moment.locale("en");
    fancydates(0, "YYYY-MM-DD HH:mm");
    </script><!-- end fancy dates --><script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-51330059-1', 'auto');
  ga('send', 'pageview');

</script>
</body>
</html>
